import store from "@/store";
export const typeListAll = () => {
  return [
    { value: "1", label: "显示" },
    { value: "0", label: "隐藏" }
  ];
};
export const xingList = () => {
  return [
    { value: "circle", label: "圆形" },
    { value: "rect", label: "方形" },
    { value: "diamond", label: "菱形" },
    { value: "custom-rect", label: "可缩放方形" }
  ];
};
export const searchRule = isAdmin => {
  return [
    {
      type: "select",
      field: "companyId",
      title: "单位",
      options: store.state.companyList,
      value: store.state.companyId
        ? Number(store.state.companyId)
        : store.state.companyList.length
        ? store.state.companyList[0].value
        : null,
      col: {
        span: 4
      },
      hidden: isAdmin ? false : true
    }
  ];
};

export const editRule = isAdmin => {
  return [
    {
      type: "hidden",
      hidden: true,
      field: "id",
      title: "ID",
      value: null,
      tableVisible: false,
      hidden: true
    },
    {
      type: "input",
      field: "textName",
      title: "节点名称",
      value: "",
      tableVisible: true,
      validate: {
        required: true,
        message: "请填写节点名称!"
      }
    },
    {
      type: "select",
      field: "type",
      title: "节点形状",
      value: "",
      options: xingList(),
      tableVisible: true
    },
    {
      type: "select",
      field: "isStartUser",
      title: "开始用户处理",
      value: false,
      options: [
        {
          value: true,
          label: "是"
        },
        {
          value: false,
          label: "否"
        }
      ],
      tableVisible: true
    },
    {
      type: "select",
      field: "handelRole",
      title: "处理角色",
      value: "",
      options: [],
      props: {
        clearable: true,
        filterable: true,
        multiple: false
      },
      tableVisible: true
    },
    {
      type: "select",
      field: "handelUser",
      title: "处理人",
      value: "",
      options: [],
      props: {
        clearable: true,
        "collapse-tags": true,
        filterable: true,
        multiple: true
      },
      tableVisible: true
    }
    // {
    //   type: "select",
    //   field: "flowTempId",
    //   title: "模板表单",
    //   value: "",
    //   options: [],
    //   tableVisible: true
    // }
  ];
};
